<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="invIngresoSearch" styleClass="edit">

        <rich:simpleTogglePanel label="filtro de busqueda  ingreso" switchType="ajax">

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Observacion</ui:define>
                <h:inputText id="ingObservacion" value="#{invIngresoList.invIngreso.ingObservacion}"/>
            </s:decorate>
            
            
            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Numero de ingreso</ui:define>
                <h:inputText id="ingObservacion" value="#{invIngresoList.invIngreso.buscadorIngCodigo}"/>
            </s:decorate>

           <s:decorate template="layout/display.xhtml">
           <ui:define name="label">Proveedor:</ui:define>
<h:selectOneMenu value="#{invIngresoList.invIngreso.buscadorProveedor}"
    defaultLabel="Seleccione..." 
                directInputSuggestions="true"
                enableManualInput="false" 
>

<f:selectItems value="#{grupoListado.listaBusquedaDeProveedorSelectItems}"  />
</h:selectOneMenu>
</s:decorate>
        </rich:simpleTogglePanel>

        <div class="actionButtons">
            <h:commandButton id="search" value="Buscar" action="/InvIngresoList.xhtml"/>
            <s:button id="reset" value="Limpiar" includePageParams="false"/>
        </div>

    </h:form>

    <rich:panel>
        <f:facet name="header">Resultado de busqueda</f:facet>
    <div class="results" id="invIngresoList">

    <h:outputText value="No hay resultado de  busqueda !!!!"
               rendered="#{empty invIngresoList.resultList}"/>

    <rich:dataTable id="invIngresoList"
                var="_invIngreso"
              value="#{invIngresoList.resultList}"
           rendered="#{not empty invIngresoList.resultList}">
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="N# Ingreso"/>
                    <ui:param name="propertyPath" value="invIngreso.ingCodigo"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.ingCodigo}"/>
        </h:column>
           <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="N# Factura"/>
                    <ui:param name="propertyPath" value="invIngreso.ingNumFactura"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.ingNumFactura}"/>
        </h:column>
     
     
     <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="Cur"/>
                    <ui:param name="propertyPath" value="invIngreso.ingCur"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.ingCur}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="Fecha"/>
                    <ui:param name="propertyPath" value="invIngreso.ingFecha"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.ingFecha}">
                <s:convertDateTime type="date" pattern="MM/dd/yyyy"/>
            </h:outputText>
        </h:column>
         <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="Proveedor"/>
                    <ui:param name="propertyPath" value="invIngreso.invProveedor.proCodigo"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.invProveedor.proNombre}"/>
        </h:column>
       
             <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="Observaciones"/>
                    <ui:param name="propertyPath" value="invIngreso.ingObservacion"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.ingObservacion}"/>
        </h:column>
   
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="Descuento"/>
                    <ui:param name="propertyPath" value="invIngreso.ingDescuento"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.ingDescuento}">
                <f:convertNumber/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="Iva"/>
                    <ui:param name="propertyPath" value="invIngreso.ingIva"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.ingIva}">
                <f:convertNumber/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invIngresoList}"/>
                    <ui:param name="propertyLabel" value="Precio Total"/>
                    <ui:param name="propertyPath" value="invIngreso.ingPrecioTotal"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invIngreso.ingPrecioTotal}">
            <f:convertNumber />
                <f:convertNumber/>
            </h:outputText>
        </h:column>
        <rich:column styleClass="action">
            <f:facet name="header">Acciones</f:facet>
            <s:link view="/#{empty from ? 'InvIngreso' : from}.xhtml"
                   value="#{empty from ? 'Ver' : 'Seleccionar'}"
             propagation="#{empty from ? 'none' : 'default'}"
                      id="invIngreso">
                <f:param name="invIngresoIngCodigo"
                        value="#{_invIngreso.ingCodigo}"/>
            </s:link>
            #{' '}
        </rich:column>
    </rich:dataTable>

    </div>
    </rich:panel>

    <div class="tableControl">

        <s:link view="/InvIngresoList.xhtml"
            rendered="#{invIngresoList.previousExists}"
               value="#{messages.left}#{messages.left} First Page"
                  id="firstPage">
          <f:param name="firstResult" value="0"/>
        </s:link>

        <s:link view="/InvIngresoList.xhtml"
            rendered="#{invIngresoList.previousExists}"
               value="#{messages.left} Previous Page"
                  id="previousPage">
            <f:param name="firstResult"
                    value="#{invIngresoList.previousFirstResult}"/>
        </s:link>

        <s:link view="/InvIngresoList.xhtml"
            rendered="#{invIngresoList.nextExists}"
               value="Next Page #{messages.right}"
                  id="nextPage">
            <f:param name="firstResult"
                    value="#{invIngresoList.nextFirstResult}"/>
        </s:link>

        <s:link view="/InvIngresoList.xhtml"
            rendered="#{invIngresoList.nextExists}"
               value="Last Page #{messages.right}#{messages.right}"
                  id="lastPage">
            <f:param name="firstResult"
                    value="#{invIngresoList.lastFirstResult}"/>
        </s:link>

    </div>

    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/InvIngresoEdit.xhtml"
                    id="create"
           propagation="none"
                 value="Crear ingreso">
            <f:param name="invIngresoIngCodigo"/>
        </s:button>
    </s:div>

</ui:define>

</ui:composition>
